package a.f.l;

import a.c.ab;
import a.c.bb;
import a.c.d;
import a.c.e;
import a.c.k;
import a.c.m;
import a.c.q;
import a.c.z;
import a.f.ad;
import a.f.o;
import a.f.wc;
import a.f.zc;

import java.awt.geom.Rectangle2D;
import java.util.Collection;
import java.util.Iterator;

class u
{
  private static final byte a = 15;
  
  public static byte a(o paramo, e parame, a.d.w paramw)
  {
    int i = g.Cc;
    zc localzc = paramo.k(parame);
    double d1 = localzc.a();
    double d2 = localzc.b();
    double d3 = d1 + localzc.c();
    double d4 = d2 + localzc.d();
    if (i == 0) {
      if (paramw.a < d1) {
        return 8;
      }
    }
    if (i == 0) {
      if (paramw.a > d3) {
        return 4;
      }
    }
    if (i == 0) {
      if (paramw.b < d2) {
        return 1;
      }
    }
    if (i == 0) {
      if (paramw.b > d4) {
        return 2;
      }
    }
    return 15;
  }
  
  public static byte a(o paramo, e parame1, a.d.w paramw, e parame2)
  {
    int i = g.Cc;
    zc localzc = paramo.k(parame2);
    double d1 = localzc.a();
    double d2 = localzc.b();
    double d3 = d1 + localzc.c();
    double d4 = d2 + localzc.d();
    if (i == 0) {
      switch (a(paramo, parame1, paramw))
      {
      case 1: 
        if (i == 0) {
          if (d1 < paramw.a)
          {
            if (i != 0) {
              break label152;
            }
            if (d3 < paramw.a) {
              return 8;
            }
          }
        }
        if (i == 0) {
          if (d1 > paramw.a)
          {
            if (i != 0) {
              break label184;
            }
            if (d3 > paramw.a) {
              return 4;
            }
          }
        }
        if (i == 0) {
          if (d4 < paramw.b) {
            return 1;
          }
        }
        if (i == 0) {
          if (d2 > paramw.b) {
            return 2;
          }
        }
      case 2: 
        if (i == 0) {
          if (d1 < paramw.a)
          {
            if (i != 0) {
              break label251;
            }
            if (d3 < paramw.a) {
              return 8;
            }
          }
        }
        if (i == 0) {
          if (d1 > paramw.a)
          {
            if (i != 0) {
              break label283;
            }
            if (d3 > paramw.a) {
              return 4;
            }
          }
        }
        if (i == 0) {
          if (d4 < paramw.b) {
            return 1;
          }
        }
        if (i == 0) {
          if (d2 > paramw.b) {
            return 2;
          }
        }
      case 8: 
        if (i == 0) {
          if (d2 < paramw.b)
          {
            if (i != 0) {
              break label349;
            }
            if (d4 < paramw.b) {
              return 1;
            }
          }
        }
        if (i == 0) {
          if (d2 > paramw.b)
          {
            if (i != 0) {
              break label381;
            }
            if (d4 > paramw.b) {
              return 2;
            }
          }
        }
        if (i == 0) {
          if (d3 < paramw.a) {
            return 8;
          }
        }
        if (i == 0) {
          if (d1 > paramw.a) {
            return 4;
          }
        }
      case 4: 
        label152:
        label184:
        label251:
        label381:
        if (i == 0) {
          if (d2 < paramw.b)
          {
            if (i != 0) {
              break label448;
            }
            if (d4 < paramw.b) {
              return 1;
            }
          }
        }
        label283:
        label349:
        if (i == 0) {
          if (d2 > paramw.b)
          {
            if (i != 0) {
              break label480;
            }
            if (d4 > paramw.b) {
              return 2;
            }
          }
        }
        label448:
        label480:
        if (i == 0) {
          if (d3 < paramw.a) {
            return 8;
          }
        }
        if (i == 0) {
          if (d1 > paramw.a) {
            return 4;
          }
        }
        break;
      }
    }
    return 15;
  }
  
  public static Rectangle2D a(o paramo, e parame, bb parambb, byte paramByte)
  {
    int j = g.Cc;
    int i = g.Bc;
    Rectangle2D localRectangle2D = wc.a(paramo, parambb.l());
    Rectangle2D.Double localDouble = new Rectangle2D.Double();
    double d1;
    double d2;
    double d3;
    double d4;
    switch (paramByte)
    {
    case 1: 
      d1 = Math.min(paramo.p(parame), localRectangle2D.getX());
      d2 = localRectangle2D.getY() + localRectangle2D.getHeight();
      d3 = Math.max(paramo.p(parame) + paramo.s(parame), localRectangle2D.getX() + localRectangle2D.getWidth()) - d1;
      d4 = paramo.q(parame) - d2;
      if (j == 0)
      {
        localDouble.setFrame(d1, d2, d3, d4);
        if (i == 0) {
          break;
        }
      }
      break;
    case 2: 
      d1 = Math.min(paramo.p(parame), localRectangle2D.getX());
      d2 = paramo.q(parame) + paramo.t(parame);
      d3 = Math.max(paramo.p(parame) + paramo.s(parame), localRectangle2D.getX() + localRectangle2D.getWidth()) - d1;
      d4 = localRectangle2D.getY() - d2;
      if (j == 0)
      {
        localDouble.setFrame(d1, d2, d3, d4);
        if (i == 0) {
          break;
        }
      }
      break;
    case 8: 
      d1 = localRectangle2D.getX() + localRectangle2D.getWidth();
      d2 = Math.min(localRectangle2D.getY(), paramo.q(parame));
      d3 = paramo.p(parame) - (localRectangle2D.getX() + localRectangle2D.getWidth());
      d4 = Math.max(paramo.q(parame) + paramo.t(parame), localRectangle2D.getY() + localRectangle2D.getHeight()) - d2;
      if (j == 0)
      {
        localDouble.setFrame(d1, d2, d3, d4);
        if (i == 0) {
          break;
        }
      }
      break;
    case 4: 
      d1 = paramo.p(parame) + paramo.s(parame);
      d2 = Math.min(localRectangle2D.getY(), paramo.q(parame));
      d3 = localRectangle2D.getX() - d1;
      d4 = Math.max(paramo.q(parame) + paramo.t(parame), localRectangle2D.getY() + localRectangle2D.getHeight()) - d2;
      localDouble.setFrame(d1, d2, d3, d4);
    }
    return localDouble;
  }
  
  public static bb a(o paramo, e parame, bb parambb, byte paramByte, double paramDouble)
  {
    int j = g.Cc;
    int i = g.Bc;
    zc localzc1 = paramo.k(parame);
    double d1 = localzc1.a();
    double d2 = localzc1.b();
    double d3 = d1 + localzc1.c();
    double d4 = d2 + localzc1.d();
    bb localbb = new bb();
    a.c.w localw = parambb.l();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      zc localzc2 = paramo.k(locale);
      if (j == 0)
      {
        switch (paramByte)
        {
        case 1: 
          if (j != 0) {
            continue;
          }
          if (d2 - paramDouble >= localzc2.b() + localzc2.d())
          {
            localbb.add(locale);
            if (j != 0) {
              continue;
            }
            if (i == 0) {
              break;
            }
          }
          break;
        case 2: 
          if (j != 0) {
            continue;
          }
          if (d4 + paramDouble <= localzc2.b())
          {
            localbb.add(locale);
            if (j != 0) {
              continue;
            }
            if (i == 0) {
              break;
            }
          }
          break;
        case 8: 
          if (j != 0) {
            continue;
          }
          if (d1 - paramDouble >= localzc2.a() + localzc2.c())
          {
            localbb.add(locale);
            if (j != 0) {
              continue;
            }
            if (i == 0) {
              break;
            }
          }
          break;
        case 4: 
          if (j != 0) {
            continue;
          }
          if (d3 + paramDouble <= localzc2.a()) {
            localbb.add(locale);
          }
          break;
        }
        localw.f();
      }
    } while (i == 0);
    return localbb;
  }
  
  public static byte a(o paramo, e parame, ab paramab, boolean paramBoolean)
  {
    int j = g.Cc;
    int i = g.Bc;
    zc localzc1 = paramo.k(parame);
    double d1 = localzc1.a();
    double d2 = localzc1.b();
    double d3 = d1 + localzc1.c();
    double d4 = d2 + localzc1.d();
    double[] arrayOfDouble = new double[4];
    m localm = paramab.l();
    if (localm.e()) {}
    while (j != 0)
    {
      e locale = paramBoolean ? localm.a().e() : localm.a().f();
      zc localzc2 = paramo.k(locale);
      if (j == 0) {
        if (localzc2.b() + localzc2.d() < d2) {
          arrayOfDouble[0] += 1.0D;
        }
      }
      if (j == 0) {
        if (localzc2.b() > d4) {
          arrayOfDouble[1] += 1.0D;
        }
      }
      if (j == 0) {
        if (localzc2.a() + localzc2.c() < d1) {
          arrayOfDouble[2] += 1.0D;
        }
      }
      if (j == 0)
      {
        if (localzc2.a() > d3) {
          arrayOfDouble[3] += 1.0D;
        }
        localm.f();
      }
      if (i == 0) {
        break;
      }
    }
    double d5 = arrayOfDouble[0];
    byte b = 1;
    if (j == 0) {
      if (arrayOfDouble[1] > d5)
      {
        d5 = arrayOfDouble[1];
        b = 2;
      }
    }
    if (j == 0) {
      if (arrayOfDouble[2] > d5)
      {
        d5 = arrayOfDouble[2];
        b = 8;
      }
    }
    if (j == 0) {
      if (arrayOfDouble[3] > d5)
      {
        d5 = arrayOfDouble[3];
        b = 4;
      }
    }
    return b;
  }
  
  private static ad a(d paramd, boolean paramBoolean, q paramq)
  {
    int j = g.Cc;
    int i = g.Bc;
    Object localObject1 = paramBoolean ? ad.q : ad.r;
    k localk = paramq.c(localObject1);
    if ((j != 0) || (localk != null))
    {
      if (j != 0) {
        break label67;
      }
      if (localk.get(paramd) != null) {}
    }
    else
    {
      return null;
    }
    label67:
    Collection localCollection = (Collection)localk.get(paramd);
    if (localCollection.isEmpty()) {
      return null;
    }
    Object localObject2 = null;
    Iterator localIterator = localCollection.iterator();
    while (localIterator.hasNext())
    {
      ad localad = (ad)localIterator.next();
      if (j == 0) {
        if (localObject2 == null) {
          localObject2 = localad;
        }
      }
      if (!localad.b())
      {
        if ((j != 0) || (i != 0)) {
          break label159;
        }
        localObject2 = localad;
      }
    }
    label159:
    return localObject2;
  }
  
  private static boolean a(ad paramad)
  {
    int i = g.Cc;
    if (((i != 0) || (paramad.a(4))) && ((i != 0) || (paramad.a(8))) && ((i != 0) || (paramad.a(1)))) {
      if (i != 0) {}
    }
    return paramad.a(2);
  }
  
  public static byte a(o paramo, e parame, ab paramab)
  {
    int j = g.Cc;
    int i = g.Bc;
    zc localzc1 = paramo.k(parame);
    double d1 = localzc1.a();
    double d2 = localzc1.b();
    double d3 = d1 + localzc1.c();
    double d4 = d2 + localzc1.d();
    double[] arrayOfDouble = new double[4];
    ad localad1 = a(paramab.m(), false, paramo);
    if (((j != 0) || (localad1 != null)) && ((j != 0) || (!a(localad1))))
    {
      if (j == 0) {
        if (localad1.a(1)) {
          arrayOfDouble[0] += 1.0D;
        }
      }
      if (j == 0) {
        if (localad1.a(4)) {
          arrayOfDouble[1] += 1.0D;
        }
      }
      if (j == 0) {
        if (localad1.a(8)) {
          arrayOfDouble[2] += 1.0D;
        }
      }
      if (localad1.a(4)) {
        arrayOfDouble[3] += 1.0D;
      }
    }
    m localm = paramab.l();
    do
    {
      do
      {
        if (!localm.e()) {
          break;
        }
        d locald = localm.a();
        ad localad2 = a(locald, true, paramo);
        if (i != 0) {
          break label528;
        }
        if (((j != 0) || (localad2 != null)) && ((j != 0) || (!a(localad2))))
        {
          if (j == 0) {
            if (localad2.a(2)) {
              arrayOfDouble[0] += 1.0D;
            }
          }
          if (j == 0) {
            if (localad2.a(1)) {
              arrayOfDouble[1] += 1.0D;
            }
          }
          if (j == 0) {
            if (localad2.a(4)) {
              arrayOfDouble[2] += 1.0D;
            }
          }
          if (localad2.a(8)) {
            arrayOfDouble[3] += 1.0D;
          }
        }
        e locale = locald.e();
        zc localzc2 = paramo.k(locale);
        if (j == 0) {
          if (localzc2.b() + localzc2.d() < d2) {
            arrayOfDouble[0] += 1.0D;
          }
        }
        if (j == 0) {
          if (localzc2.b() > d4) {
            arrayOfDouble[1] += 1.0D;
          }
        }
        if (j == 0) {
          if (localzc2.a() + localzc2.c() < d1) {
            arrayOfDouble[2] += 1.0D;
          }
        }
        if (j == 0)
        {
          if (localzc2.a() > d3) {
            arrayOfDouble[3] += 1.0D;
          }
          localm.f();
        }
      } while (i == 0);
    } while (j != 0);
    if (j == 0)
    {
      if (a(paramo, paramab))
      {
        arrayOfDouble[2] += 0.5D;
        if (j != 0) {
          break label541;
        }
        arrayOfDouble[3] += 0.5D;
      }
    }
    else {
      if (i == 0) {
        break label538;
      }
    }
    arrayOfDouble[0] += 0.5D;
    label528:
    arrayOfDouble[1] += 0.5D;
    label538:
    label541:
    double d5 = arrayOfDouble[0];
    byte b = 1;
    if (j == 0) {
      if (arrayOfDouble[1] > d5)
      {
        d5 = arrayOfDouble[1];
        b = 2;
      }
    }
    if (j == 0) {
      if (arrayOfDouble[2] > d5)
      {
        d5 = arrayOfDouble[2];
        b = 8;
      }
    }
    if (j == 0) {
      if (arrayOfDouble[3] > d5)
      {
        d5 = arrayOfDouble[3];
        b = 4;
      }
    }
    return b;
  }
  
  static boolean a(o paramo, ab paramab)
  {
    int j = g.Cc;
    int i = g.Bc;
    double d1 = 0.0D;
    double d2 = 0.0D;
    m localm1 = paramab.l();
    do
    {
      if (!localm1.e()) {
        break;
      }
      d locald = localm1.a();
      d1 += paramo.m(locald.e());
      if (j != 0) {
        break label112;
      }
      d2 += paramo.n(locald.e());
      localm1.f();
      if (i != 0) {
        break label111;
      }
    } while (i == 0);
    d1 /= paramab.size();
    if (j == 0) {
      d2 /= paramab.size();
    }
    label111:
    label112:
    double d3 = 0.0D;
    double d4 = 0.0D;
    m localm2 = paramab.l();
    do
    {
      do
      {
        if (!localm2.e()) {
          break;
        }
        double d5 = d1 - paramo.m(localm2.a().e());
        d3 += d5 * d5;
        d5 = d2 - paramo.n(localm2.a().e());
        d4 += d5 * d5;
        localm2.f();
        if ((j == 0) && (i != 0)) {
          break label234;
        }
      } while (i == 0);
    } while (j != 0);
    if (j == 0) {}
    label234:
    return d4 > d3;
  }
  
  public static byte a(byte paramByte)
  {
    if (g.Cc == 0) {
      switch (paramByte)
      {
      case 1: 
        return 2;
      case 2: 
        return 1;
      case 8: 
        return 4;
      case 4: 
        return 8;
      }
    }
    return 15;
  }
  
  public static boolean a(a.d.w paramw1, a.d.w paramw2)
  {
    if (g.Cc == 0) {}
    return paramw1.a == paramw2.a;
  }
  
  public static boolean b(a.d.w paramw1, a.d.w paramw2)
  {
    if (g.Cc == 0) {}
    return paramw1.b == paramw2.b;
  }
  
  public static byte a(o paramo, e parame, z paramz)
  {
    int i = g.Cc;
    a.d.w localw1 = (a.d.w)paramz.a(0);
    a.d.w localw2 = (a.d.w)paramz.a(1);
    if (i == 0) {
      if (localw1.a == localw2.a)
      {
        if (i == 0) {
          if (localw1.b < paramo.n(parame)) {
            return 1;
          }
        }
        return 2;
      }
    }
    if (i == 0) {
      if (localw1.a < paramo.m(parame)) {
        return 8;
      }
    }
    return 4;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.l.u

 * JD-Core Version:    0.7.0.1

 */